package com.sasis.dao.ibatis;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.sasis.dao.UserFunctionPermissionDao;
import com.sasis.model.UserFunctionPermission;

public class UserFunctionPermissionDaoIbatisImpl extends BaseDaoIbatisImpl implements UserFunctionPermissionDao {

	public UserFunctionPermissionDaoIbatisImpl() {
		super(UserFunctionPermission.class);
	}

	public UserFunctionPermission loadByPermission(Long userId, Long functionId) {
		Map params = new HashMap();
		params.put("userId", userId);
		params.put("functionId", functionId);
		return (UserFunctionPermission) getSqlMapClientWrapper().queryForObject("loadByPermission", params);
	}
	
	public Collection findByAllow(Long userId) {
		return getSqlMapClientWrapper().queryForList("findByAllow", userId);
	}
}
